package com.yby.dome1;

import com.yby.dome1.Student;

public class StudentSort {
    Student[] stu;
    public void sort(Student[] stu){
        for (int i = 0; i < stu.length-1; i++) {
            if (stu[i].getScore() < stu[i+1].getScore()){
                Student temp = stu[i];
                stu[i] = stu[i+1];
                stu[i+1] = temp;
            }
        }
        for (int i = 0; i<stu.length;i++) {
            System.out.println(stu[i].getName()+" "+stu[i].getId()+" "+stu[i].getScore());
        }
    }
}
